package com.priox.sigar.ws;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.transport.http.HTTPConduit;

import javax.xml.ws.BindingProvider;

public class Main {

    public static void main(String[] args) {
        JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
        factoryBean.setServiceClass(GenericInvoker.class);

        factoryBean.setAddress("http://localhost:8080/ws/invoker");
        GenericInvoker invoker = (GenericInvoker) factoryBean.create();
        Client cl = ClientProxy.getClient(invoker);
        HTTPConduit httpConduit = (HTTPConduit) cl.getConduit();

        httpConduit.getClient().setReceiveTimeout(0);

        System.out.println("result "+invoker.invoke());
    }
}
